package ooday09;

public class InnerClassDemo {
        public static void main(String[] args) {
            Mama m = new Mama();
            //Baby b = new Baby(); //编译错误，内部类对外不具备可见性
        }
    }

    class Mama{ //外部类
        private String name;
        void create(){
            Baby b = new Baby(); //正确，内部类通常在外部类中创建
        }
        class Baby{ //成员内部类
            void showName(){
                System.out.println(name);
                System.out.println(Mama.this.name);
                //System.out.println(this.name); //编译错误，this指代当前Baby对象
            }
        }
    }

